package com.shketai.service;

import java.util.Date;
import java.util.List;
import java.util.Map;

import com.shketai.dao.AttenceDao;
import com.shketai.entity.Attence;
import com.shketai.entity.Count;
import com.shketai.entity.PageBean;
import com.shketai.entity.Student;


public class AttenceService {

	private AttenceDao attenceDao;

	public void setAttenceDao(AttenceDao attenceDao) {
		this.attenceDao = attenceDao;
	}
	/**
	 * 查看考勤
	 * @param user_id
	 * @return
	 */
	public List<Map<String,Object>> findAttenceById(int user_id){
		return attenceDao.findAttenceById(user_id);
	}
	
	
	/**
	 * 考勤
	 * @param stu_id
	 */
	public void add(List<Integer> stu_id,int attence_status,int classinfo_id,int reason_id) {
		attenceDao.add(stu_id, attence_status, classinfo_id,reason_id);
	}
	
	/**
	 * 考勤统计
	 * @return
	 */
	public List<Attence>  CountAttence(){
		return attenceDao.CountAttence();
	}
	
	/**
	 * 学生考勤汇总
	 * @return
	 */
	public PageBean<Object[]>Attendancesummary(int page,int classinfo_id){
		PageBean<Object[]> pb = new PageBean<Object[]>();
		List<Object[]> list = attenceDao.Attendancesummary(page, classinfo_id);
		pb.setDatas(list);
		int total = attenceDao.findCount(classinfo_id);
		pb.setTotal(total);
		return pb;
		
	}
	
	/**
	 * 学生考勤汇总
	 * @return
	 */
	public List<Object[]>Attendancesummary1(int classinfo_id){
		
		List<Object[]> list = attenceDao.Attendancesummary1( classinfo_id);
		return list;
		
	}
	
	public List<Attence> UnAttence(int user_id) {
		 return attenceDao.UnAttence(user_id);
		
	}
	
}
